plotF1 <- function(model) {
  dataXy <- data.frame(cbind(model$X, model$y))
  coef_df1 <- as.data.frame(rbind(-model$coef1[c(1, 3)]/model$coef1[2], 
                                 -model$coef2[c(1, 3)]/model$coef2[2]))
  coef_1 <- model$coef1
  coef_2 <- model$coef2
  coef_1[3] <- coef_1[3] + 1
  coef_2[3] <- coef_2[3] - 1
  coef_df2 <- as.data.frame(rbind(-coef_1[c(1, 3)]/coef_1[2], 
                                  -coef_2[c(1, 3)]/coef_2[2]))
  
  colnames(coef_df1) <- c("slope", "intercept")
  colnames(coef_df2) <- c("slope", "intercept")
  
  print(coef_df1)
  colnames(dataXy) <- c("X1", "X2", "y")
  dataXy$y <- factor(dataXy$y)
  ggplot(dataXy) + 
    geom_point(aes(x = X1, y = X2, color = y)) +
    scale_color_manual(values = c("red", "blue")) + 
    geom_abline(slope = coef_df1$slope, intercept = coef_df1$intercept,
                color = c("red", "blue")) + 
    geom_abline(slope = coef_df2$slope, intercept = coef_df2$intercept,
                color = c("red", "blue"), linetype = 2) +
    theme_bw() +
    xlab("") + ylab("") +
    theme(axis.title.x = element_blank(),
          axis.title.y = element_blank(),
          legend.position = "none",
          legend.position.inside = c(0.90, 0.25)) +
    # geom_rect(xmin = -25, xmax = -18, ymin = -22, ymax = -18,
    #           color = "black", alpha = 0)
    annotate("rect", xmin = -22, xmax = -19, ymin = -22, ymax = -18,
             color = "black", alpha = 0) + 
    annotate("segment", x = -15, xend = -19, y = -12, yend = -18,
             colour = "black", linewidth = 0.8, arrow = arrow()) +
    annotate("text", x = -15, y = -10, label = "Outliers")
}



